﻿using BCDto.OA.GeneralDatabaseOperation;
using System;
using System.Collections.Generic;
using System.Text;

namespace BCService.OA.GeneralDatabasesOperation
{
    /// <summary>
    /// 通用数据库操作
    /// </summary>
    public interface IGeneralDatabasesOperationService
    {
        /// <summary>
        /// 获取所有允许访问的数据库名称列表
        /// </summary>
        /// <returns></returns>
        IEnumerable<GeneralDatabaseOperationDatabaseNameDto> GetAllDatabaseName();
        /// <summary>
        /// 获取所有表名称列表
        /// </summary>
        /// <param name="databaseName">数据库名称</param>
        /// <returns></returns>
        IEnumerable<GeneralDatabaseOperationTableNameDto> GetAllTableName(string databaseName);
        /// <summary>
        /// 获取所有列名称
        /// </summary>
        /// <param name="databaseName">数据库名称</param>
        /// <param name="tableName">表名称</param>
        /// <returns></returns>
        IEnumerable<GeneralDatabaseOperationColumnNameDto> GetAllColumnName(string databaseName,string tableName);
        /// <summary>
        /// 获取所有数据
        /// </summary>
        /// <param name="databaseName">数据库名称</param>
        /// <param name="tableName">表名称</param>
        /// <returns></returns>
        IEnumerable<object> GetTableDataList(string databaseName,string tableName);
        /// <summary>
        /// 获取数据
        /// </summary>
        /// <param name="queryDto">查询信息</param>
        /// <returns></returns>
        IEnumerable<Object> GetTableData(GeneralDatabasesOperationQueryDto queryDto);
    }
}
